# This controller handles the login/logout function of the site.
class SessionController < ApplicationController
    include OpenAccount::OpenSessionController
    layout "default"
    before_filter :set_page_title
    
    
    protected
    
    def successful_login(new_user)
        logger.info "sucessful login for #{self.current_user.login}"
        redirect_to(user_aggregations_path(self.current_user))
        flash[:notice] = "" #{}"#{self.current_user.login} logged in successfully"
        if new_user
            send_welcome
        end
    end
    
    def set_page_title
        @page_title = 'Sign In'
        @page_title = 'Sign In' if params[:action] == 'new'
        @page_title = 'Sign Out' if params[:action] == 'destroy'
    end
    
end
